package com.atguigu.gmall.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gmall.product.entity.BaseCategory3;
import com.atguigu.gmall.product.service.BaseCategory3Service;
import com.atguigu.gmall.product.mapper.BaseCategory3Mapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 李天玉
 * @description 针对表【base_category3(三级分类表)】的数据库操作Service实现
 * @createDate 2025-08-15 14:26:51
 */
@Service
public class BaseCategory3ServiceImpl extends ServiceImpl<BaseCategory3Mapper, BaseCategory3>
        implements BaseCategory3Service {
    /**
     * 根据2级分类id，查找对应的3级分类id
     *
     * @param category2_id
     * @return
     */
    @Override
    public List<BaseCategory3> getCategory3(Long category2_id) {
        LambdaQueryWrapper<BaseCategory3> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BaseCategory3::getCategory2Id, category2_id);
        List<BaseCategory3> list = list(wrapper);
        return list;
    }
}




